package com.liqing.movecomment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.liqing.movecomment.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (Comment)表数据库访问层
 *
 * @author makejava
 * @since 2023-04-16 00:24:17
 */
@Mapper
public interface CommentDao extends BaseMapper<Comment> {


    @Select("select count(*) from comment where parent = #{parent}")
    int selectCountByParentId(String parent);

    @Select("  select * from comment where root = #{rootId}")
    List<Comment> selectAllByRoot(String rootId);


}

